#ifndef BULLET_H
#define BULLET_H

#include <QGraphicsPixmapItem>
#include <QPointF>
#include <QObject>

class Bullet : public QObject, public QGraphicsPixmapItem
{
    Q_OBJECT
public:
    Bullet(QGraphicsItem *parent = nullptr);

    void setDirection(const QPointF &direction);
    void move();

    int damage() const;
    qreal speed() const;

private:
    qreal m_speed;
    int m_damage;
    QPointF m_direction; // 单位方向向量
};

#endif // BULLET_H
